﻿@model ExtremeEvents.Models.Utilizador
@{
    ViewBag.Title = "Registar";
}

<script type="text/javascript">
    //alterar estado dos botoes
    activarBotao("areacliente"); //alterar para o nome da view
</script>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    
    <div class="wrapper">
    <div class="grid_4" style="width:98%;">
	    <h3>Criar nova conta</h3>
	    <div class="bg maxheight">
		    <div class="content-indents">
                <h6 class="title1 p2-1">Conta</h6>
                <fieldset>
                @{
                    if (ViewBag.erro == "")
                    {
                         @Html.ValidationSummary(true, "Error_15: Ocorreram erros ao criar a conta. Por favor corrija os erros e tente de novo.")
                    }
                    else
                    { 
                        @Html.ValidationSummary(true, (string)ViewBag.erro)
                    }
                }
                    <table>
                        <tr>
                            <td align="right" width="150">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Login)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Login)
                                    @Html.ValidationMessageFor(m => m.Login)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Email)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Email)
                                    @Html.ValidationMessageFor(m => m.Email)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Password)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.PasswordFor(m => m.Password)
                                    @Html.ValidationMessageFor(m => m.Password)
                                    As passwords devem ter no minimo @Membership.MinRequiredPasswordLength caracteres.
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Confirmacao_Password)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.PasswordFor(m => m.Confirmacao_Password)
                                    @Html.ValidationMessageFor(m => m.Confirmacao_Password)
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
                <fieldset>
                    <br />
                    <h6 class="title1 p2-1">Dados pessoais</h6>
                    <table>
                        <tr>
                            <td align="right" width="150">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Primeiro_Nome)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Primeiro_Nome)
                                </div>
                            </td>
                            <td align="right" width="100">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Ultimo_Nome)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Ultimo_Nome)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Nif)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Nif)
                                    @Html.ValidationMessageFor(m => m.Nif)
                                </div>
                            </td>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Genero)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-label">
                                    @Html.RadioButtonFor(m => m.Genero, "Masculino") Masculino
                                    @Html.RadioButtonFor(m => m.Genero, "Feminino") Feminino
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Nome_Organizacao)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Nome_Organizacao)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Morada)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Morada)
                                </div>
                            </td>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Numero)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Numero)
                                </div>
                            </td>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Codigo_Postal)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Codigo_Postal)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Distrito)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Distrito)
                                </div>
                            </td>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Concelho)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Concelho)
                                </div>
                            </td>
                            <td align="right" width="100">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Freguesia)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.TextBoxFor(m => m.Freguesia)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="editor-label">
                                    <h6 class="p1">@Html.LabelFor(m => m.Pais)</h6>
                                </div>
                            </td>
                            <td>
                                <div class="editor-field">
                                    @Html.DropDownListFor(m => m.Pais, new SelectList(new Dictionary<string, string> { { "Portugal", "Portugal" }, { "Outro", "Outro" } }, "Key", "Value"))
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
                </div>
            </div>
            <br />
            <div align="right" style="padding-right:20px; padding-bottom:10px;">
            <a href="javascript:$('form')[0].reset();" class="button"><span>cancelar</span></a>
            <a href="javascript:$('form')[0].submit();" class="button"><span>registar</span></a>
            </div>
        </div>
        </div>
}
